package com.xsq.newmall01.ServiceImpl.MerchantUserServiceImpl;

import com.xsq.newmall01.Dao.MerchantUser;
import com.xsq.newmall01.Mapper.MerchantMapper;
import com.xsq.newmall01.Service.MerchantUserService.MUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("merchantuserservice")
public class MUserServiceImpl implements MUserService {
    @Autowired
    private MerchantMapper merchantMapper;

    @Override
    public MerchantUser checkMerchantUserExists(MerchantUser merchantUser) {
        // 调用Mapper验证用户（登录）
        return merchantMapper.ismerchantuserexist(merchantUser);
    }

    @Override
    public void updateMerchantUser(MerchantUser merchantUser) {
        // 调用Mapper更新用户信息
        merchantMapper.updatemerchantuser(merchantUser);
    }

    @Override
    public MerchantUser getMerchantById(int id) {
        return merchantMapper.selectMerchantById(id);
    }
}
